<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/all.conf.php');
require_once(__PHY_LIB.'/inc/page.inc.php');
require_once(__PHY_LIB.'/conf/nation.conf.php');
require_once(__PHY_LIB.'/class/Intro.class.php');

$rReq = validate($_GET, 'nation:e[mala,singapore,thailand]|intro:n');
$oTpl->assign('rReq', $rReq);
$oTpl->assign('rNation', $_NATION[$rReq['nation']]);

if (0 < $rReq['intro']) {
	$oIntro = new Intro($rReq['intro']);
}
else {
	$oIntro = new Intro();
	$oIntro->cfgWhere("nation='".addslashes($rReq['nation'])."'");
	$oIntro->cfgOrder("id");
	$oIntro->load();
}
$oTpl->assign('rIntro', $oIntro->getData());
$oTpl->assign('rImages', $oIntro->fetchImages());


$oIntroList = new IntroList();
$oIntroList->cfgWhere("nation='".addslashes($rReq['nation'])."'");
$oIntroList->cfgOrder("id");
$oIntroList->load();
$oTpl->assign('rIntroList', $oIntroList->fetchArray());


$oTpl->display(dirname(__FILE__).'/'.basename(__FILE__, '.php').".tpl");
?>
